package xyz.csmcool.imroom.service;

import xyz.csmcool.imroom.entity.RoomsUser;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.csmcool.imroom.entity.vo.RoomUserVo;
import xyz.csmcool.imutil.dto.UserDto;
import xyz.csmcool.imutil.webVo.MyPage;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author csmcool
 * @since 2022-08-08
 */
public interface IRoomsUserService extends IService<RoomsUser> {

    /**
     * 查询房间用户信息通过房间号
     * @param page
     * @param limit
     * @param roomId
     * @param userId
     * @return
     */
    MyPage<UserDto> selectRoomUserInfo(Long page,Long limit,Integer roomId,Integer userId);

    /**
     * 查询房间用户信息通过用户名字
     * @param page
     * @param limit
     * @param roomId
     * @param userId
     * @param name
     * @return
     */
    MyPage<UserDto> selectRoomUserInfoByName(Long page,Long limit,Integer roomId,Integer userId,String name);

    /**
     * 得到当前聊天室的用户*
     * @param page
     * @param limit
     * @param roomId
     * @param userId
     * @return
     */
    MyPage<UserDto> getCurrentRoomUsers(Long page,Long limit,Integer roomId,Integer userId);

    /**
     * 是否是聊天室用户*
     * @param roomId
     * @param uid
     * @return
     */
    Integer isRoomUserAndMuted(Integer roomId,Integer uid);

    /**
     * 删除聊天室所有用户
     * @param roomId
     */
    void deleteRoomAllUser(Integer roomId);

    /**
     * 禁言用户
     * @param roomId
     * @param id
     * @param uid
     */
    void mutedUser(Integer roomId,Integer id,Integer uid);

    /**
     * 解封用户
     * @param roomId
     * @param id
     * @param uid
     */
    void notMutedUser(Integer roomId,Integer id,Integer uid);

    /**
     * 添加成员并且更新状态
     * @param uid
     * @param roomId
     * @param isPass
     * @return
     */
    Boolean addOrUpdateRoomUser(Integer uid,Integer roomId, Integer isPass);

    /**
     * 退出聊天室
     * @param uid
     * @param roomId
     */
    void exitCurrentRoom(Integer uid,Integer roomId);

    /**
     * 加入我的聊天室的人查询
     * @param page
     * @param limit
     * @param uid
     * @return
     */
    MyPage<RoomUserVo> getAddMyRoom(Long page,Long limit,Integer uid);

    /**
     * 审核朋友
     * @param uid
     * @param roomId
     * @param isPass *
     */
    void examineRoomUser(Integer uid,Integer roomId,Integer isPass,Integer id);

    /**
     * 通过密码加入房间
     * @param uid
     * @param roomId
     * @param password
     */
    void joinRoomByPassword(Integer uid, Integer roomId,String password);

    /**
     * 加入房间
     * @param uid
     * @param roomId
     */
    void joinRoom(Integer uid,Integer roomId);
}
